import 'package:flutter_common_fragement/generated/json/base/json_convert_content.dart';
import 'package:flutter_common_fragement/pages/common/model/common_model_entity.dart';

CommonModelEntity $CommonModelEntityFromJson(Map<String, dynamic> json) {
  final CommonModelEntity commonModelEntity = CommonModelEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    commonModelEntity.code = code;
  }
  final String? data = jsonConvert.convert<String>(json['data']);
  if (data != null) {
    commonModelEntity.data = data;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    commonModelEntity.msg = msg;
  }
  return commonModelEntity;
}

Map<String, dynamic> $CommonModelEntityToJson(CommonModelEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['data'] = entity.data;
  data['msg'] = entity.msg;
  return data;
}

extension CommonModelEntityExtension on CommonModelEntity {
  CommonModelEntity copyWith({
    int? code,
    String? data,
    String? msg,
  }) {
    return CommonModelEntity()
      ..code = code ?? this.code
      ..data = data ?? this.data
      ..msg = msg ?? this.msg;
  }
}
